﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/UserCenter.Master"
    Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%:SiteResource.Title() %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
    <script type="text/javascript" src="/Scripts/jquery-1.4.1.min.js"></script>
    <script type="text/javascript" src="/Scripts/library.js" charset="GB2312"></script>
    <script type="text/javascript" src="/Scripts/plug.js" charset="GB2312"></script>
    <script type="text/javascript">
        function DeleteThis(id) {
            var pluglib = new plug.PopFrame();
            pluglib.OpenFrame('deleteAlert', 'btnclosealert', function () {
                $('#deleteitem').val(id);
            });
        }
        function ConfirmDelete(sender) {
            var word = $('#txtconfirm').val()
            if (word == 'ok' || word == 'OK') {
                $.ajax({
                    url: '/UserCenter/DeleteResume',
                    data: { 'id': $('#deleteitem').val() },
                    cache: false,
                    type: 'post',
                    success: function (result) {
                        if (result == '1') {
                            window.location.href = window.location.href;
                        }
                        else {
                            alert('操作失败，请稍后再试');
                        }
                    }
                });
            }
            else {
                alert('如果您需要删除请输入"ok"，或者点取消');
            }     
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder" runat="server">
    <div id="deleteAlert" style="display:none;width:300px;height:250px;">
        <input type="hidden" id="deleteitem" />
        如果您最近使用过该简历进行求职，删除后可能导致供职企业无法查看您的简历。<br />
        您确定删除此简历吗？<br />
        请输入'ok'以删除该简历：<input type="text" id="txtconfirm" />
        <input type="button" value="删除" onclick="ConfirmDelete(this)" />
        <input id="btnclosealert" type="button" value="取消" />
    </div>
    <div class="usercenter-main">
        <div class="usercenter-main-topbg">
        </div>
        <div class="usercenter-main-content">
            <div class="usercenter-main-content-title">
                <div class="usercenter-main-content-title-left">
                    我的简历</div>
            </div>
            <div class="usercenter-notes">
                在这里，你可以维护你的个人简历
            </div>
            <div class="listbox2">         
            <%var list = ViewData["Resumes"] as ItemListBox<ResumeSheetModel>;
              foreach (var item in list.Data)
              { %>
              <div class="listbox-item">
                    <div class="listbox-item-title">
                        <div class="left">
                            <a href="/UserCenter/MyResume/<%:item.Id %>"><%:item.Title %></a></div>
                        <div class="right">
                            <a href="/UserCenter/MyResume/<%:item.Id %>">更新/查看</a>&nbsp;
                            <a target="_blank" href="/Home/Resume_<%:item.Id %>">预览</a>&nbsp;
                            <a href="javascript:;" onclick="DeleteThis('<%:item.Id %>')">删除</a></div>
                    </div>
                    <div class="listbox-item-bottomline">
                    </div>
                </div>
            <%} %>
        
                <div style="padding-top:10px;padding-left:20px;">
                <a href="/UserCenter/NewResume">添加新简历</a></div>

                <div class="listbox-bottom">
                    <div class="listbox-bottom-item">
                        <!--下一页-->
                        <%if (list.NextPage <= 0 || list.NextPage >= list.TotlePage-1)
                          { %>
                          <a class="next1" href="javascript:;"></a>
                        <%}
                          else
                          { %>
                        <a class="next" href="?page=<%:list.NextPage %>"></a>
                        <%} %>
                    </div>
                    <div class="listbox-bottom-item">
                        <!--上一页.-->
                        <%if (list.CurrentPage != 1 && list.PrePage <= 0)
                          { %>
                          <a class="prev1" href="javascript:;"></a>
                        <%}
                          else
                          { %>
                        <a class="prev" href="?page=<%:list.PrePage %>"></a>
                        <%} %>
                    </div>
                    <div class="listbox-bottom-item">
                        <%:list.CurrentPage + 1%>/<%:list.TotlePage%>&nbsp;&nbsp;&nbsp;
                    </div>
                </div>
            </div>
        </div>
        <div class="usercenter-main-bottombg">
        </div>
    </div>
</asp:Content>
